package c.e.a.b.f.b;

import android.app.Activity;
import android.app.Application;
import android.content.SharedPreferences.Editor;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.SystemClock;
import android.text.TextUtils;
import b.i.b.f;
import c.e.a.b.b.j.c;
import c.e.a.b.b.j.d;
import c.e.a.b.e.c.i9;
import c.e.a.b.e.c.l9;
import c.e.a.b.e.c.t9;
import c.e.a.b.e.c.v8;
import com.google.android.gms.measurement.internal.zzn;
import com.huawei.hms.jos.games.ranking.RankingConst;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class c6 extends a5 {
    public y6 c;
    public w5 d;
    public final Set<z5> e = new CopyOnWriteArraySet();
    public boolean f;
    public final AtomicReference<String> g = new AtomicReference();
    public final Object h = new Object();
    public d i = new d(null, null);
    public int j = 100;
    public final AtomicLong k = new AtomicLong(0);
    public long l = -1;
    public int m = 100;
    public final y9 n;
    public boolean o = true;
    public final v9 p = new q6(this);

    public c6(u4 u4Var) {
        super(u4Var);
        this.n = new y9(u4Var);
    }

    /* JADX WARNING: Removed duplicated region for block: B:26:0x00af  */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x0062  */
    public static void C(c.e.a.b.f.b.c6 r4, c.e.a.b.f.b.d r5, int r6, long r7, boolean r9, boolean r10) {
        /*
        r4.g();
        r4.t();
        r0 = r4.l;
        r2 = (r7 > r0 ? 1 : (r7 == r0 ? 0 : -1));
        if (r2 > 0) goto L_0x0021;
    L_0x000c:
        r0 = r4.m;
        r0 = c.e.a.b.f.b.d.e(r0, r6);
        if (r0 == 0) goto L_0x0021;
    L_0x0014:
        r4 = r4.d();
        r4 = r4.l;
        r6 = "Dropped out-of-date consent setting, proposed settings";
        r4.b(r6, r5);
        goto L_0x00be;
    L_0x0021:
        r0 = r4.l();
        java.util.Objects.requireNonNull(r0);
        r1 = c.e.a.b.e.c.v8.a();
        r2 = 0;
        if (r1 == 0) goto L_0x005f;
    L_0x002f:
        r1 = r0.a;
        r1 = r1.g;
        r3 = c.e.a.b.f.b.p.H0;
        r1 = r1.o(r3);
        if (r1 == 0) goto L_0x005f;
    L_0x003b:
        r0.g();
        r1 = r0.t(r6);
        if (r1 == 0) goto L_0x005f;
    L_0x0044:
        r0 = r0.w();
        r0 = r0.edit();
        r5 = r5.d();
        r1 = "consent_settings";
        r0.putString(r1, r5);
        r5 = "consent_source";
        r0.putInt(r5, r6);
        r0.apply();
        r5 = 1;
        goto L_0x0060;
    L_0x005f:
        r5 = 0;
    L_0x0060:
        if (r5 == 0) goto L_0x00af;
    L_0x0062:
        r4.l = r7;
        r4.m = r6;
        r5 = r4.p();
        java.util.Objects.requireNonNull(r5);
        r6 = c.e.a.b.e.c.v8.a();
        if (r6 == 0) goto L_0x00a0;
    L_0x0073:
        r6 = r5.a;
        r6 = r6.g;
        r7 = c.e.a.b.f.b.p.H0;
        r6 = r6.o(r7);
        if (r6 == 0) goto L_0x00a0;
    L_0x007f:
        r5.g();
        r5.t();
        if (r9 == 0) goto L_0x008e;
    L_0x0087:
        r6 = r5.r();
        r6.y();
    L_0x008e:
        r6 = r5.E();
        if (r6 == 0) goto L_0x00a0;
    L_0x0094:
        r6 = r5.I(r2);
        r7 = new c.e.a.b.f.b.e8;
        r7.m1406init(r5, r6);
        r5.z(r7);
    L_0x00a0:
        if (r10 == 0) goto L_0x00be;
    L_0x00a2:
        r4 = r4.p();
        r5 = new java.util.concurrent.atomic.AtomicReference;
        r5.<init>();
        r4.A(r5);
        goto L_0x00be;
    L_0x00af:
        r4 = r4.d();
        r4 = r4.l;
        r5 = java.lang.Integer.valueOf(r6);
        r6 = "Lower precedence consent source ignored, proposed source";
        r4.b(r6, r5);
    L_0x00be:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.c6.C(c.e.a.b.f.b.c6, c.e.a.b.f.b.d, int, long, boolean, boolean):void");
    }

    public final void A(d dVar, int i, long j) {
        if (v8.a() && this.a.g.o(p.H0)) {
            t();
            if (!(this.a.g.o(p.I0) && i == 20) && dVar.a == null && dVar.b == null) {
                d().k.a("Discarding empty consent settings");
                return;
            }
            boolean z;
            boolean f;
            boolean z2;
            d dVar2;
            synchronized (this.h) {
                z = false;
                if (d.e(i, this.j)) {
                    f = dVar.f(this.i);
                    if (dVar.k() && !this.i.k()) {
                        z = true;
                    }
                    d dVar3 = this.i;
                    Boolean bool = dVar.a;
                    if (bool == null) {
                        bool = dVar3.a;
                    }
                    Boolean bool2 = dVar.b;
                    if (bool2 == null) {
                        bool2 = dVar3.b;
                    }
                    d dVar4 = new d(bool, bool2);
                    this.i = dVar4;
                    this.j = i;
                    z2 = z;
                    dVar2 = dVar4;
                    z = true;
                } else {
                    dVar2 = dVar;
                    z2 = false;
                    f = false;
                }
            }
            if (z) {
                long andIncrement = this.k.getAndIncrement();
                if (f) {
                    this.g.set(null);
                    a().w(new x6(this, dVar2, j, i, andIncrement, z2));
                } else if (this.a.g.o(p.I0) && (i == 40 || i == 20)) {
                    a().w(new w6(this, dVar2, i, andIncrement, z2));
                } else {
                    a().v(new z6(this, dVar2, i, andIncrement, z2));
                }
            } else {
                d().l.b("Ignoring lower-priority consent settings, proposed settings", dVar2);
            }
        }
    }

    public final void B(w5 w5Var) {
        g();
        t();
        if (w5Var != null) {
            w5 w5Var2 = this.d;
            if (w5Var != w5Var2) {
                f.U(w5Var2 == null, "EventInterceptor already set.");
            }
        }
        this.d = w5Var;
    }

    public final void D(Boolean bool, boolean z) {
        g();
        t();
        d().m.b("Setting app measurement enabled (FE)", bool);
        l().s(bool);
        if (v8.a() && this.a.g.o(p.H0) && z) {
            d4 l = l();
            Objects.requireNonNull(l);
            if (v8.a() && l.a.g.o(p.H0)) {
                l.g();
                Editor edit = l.w().edit();
                String str = "measurement_enabled_from_api";
                if (bool != null) {
                    edit.putBoolean(str, bool.booleanValue());
                } else {
                    edit.remove(str);
                }
                edit.apply();
            }
        }
        if (!v8.a() || !this.a.g.o(p.H0) || this.a.k() || !bool.booleanValue()) {
            P();
        }
    }

    public final void E(String str, String str2, long j, Bundle bundle) {
        g();
        boolean z = this.d == null || t9.r0(str2);
        F(str, str2, j, bundle, true, z, false, null);
    }

    /* JADX WARNING: Removed duplicated region for block: B:66:0x0159  */
    public final void F(java.lang.String r29, java.lang.String r30, long r31, android.os.Bundle r33, boolean r34, boolean r35, boolean r36, java.lang.String r37) {
        /*
        r28 = this;
        r7 = r28;
        r8 = r29;
        r9 = r30;
        r10 = r31;
        r12 = r33;
        r13 = c.e.a.b.f.b.v5.a;
        r0 = "com.google.android.gms.tagmanager.TagManagerService";
        b.i.b.f.N(r29);
        r1 = "null reference";
        java.util.Objects.requireNonNull(r12, r1);
        r28.g();
        r28.t();
        r1 = r7.a;
        r1 = r1.i();
        if (r1 != 0) goto L_0x0030;
    L_0x0024:
        r0 = r28.d();
        r0 = r0.m;
        r1 = "Event not sent since app measurement is disabled";
        r0.a(r1);
        return;
    L_0x0030:
        r1 = r28.o();
        r1 = r1.i;
        if (r1 == 0) goto L_0x004a;
    L_0x0038:
        r1 = r1.contains(r9);
        if (r1 != 0) goto L_0x004a;
    L_0x003e:
        r0 = r28.d();
        r0 = r0.m;
        r1 = "Dropping non-safelisted event. event name, origin";
        r0.c(r1, r9, r8);
        return;
    L_0x004a:
        r1 = r7.f;
        r14 = 0;
        r15 = 1;
        r5 = 0;
        if (r1 != 0) goto L_0x0098;
    L_0x0051:
        r7.f = r15;
        r1 = r7.a;	 Catch:{ ClassNotFoundException -> 0x008d }
        r2 = r1.e;	 Catch:{ ClassNotFoundException -> 0x008d }
        if (r2 != 0) goto L_0x0064;
    L_0x0059:
        r1 = r1.a;	 Catch:{ ClassNotFoundException -> 0x008d }
        r1 = r1.getClassLoader();	 Catch:{ ClassNotFoundException -> 0x008d }
        r0 = java.lang.Class.forName(r0, r15, r1);	 Catch:{ ClassNotFoundException -> 0x008d }
        goto L_0x0068;
    L_0x0064:
        r0 = java.lang.Class.forName(r0);	 Catch:{ ClassNotFoundException -> 0x008d }
    L_0x0068:
        r1 = "initialize";
        r2 = new java.lang.Class[r15];	 Catch:{ Exception -> 0x0080 }
        r3 = android.content.Context.class;
        r2[r5] = r3;	 Catch:{ Exception -> 0x0080 }
        r0 = r0.getDeclaredMethod(r1, r2);	 Catch:{ Exception -> 0x0080 }
        r1 = new java.lang.Object[r15];	 Catch:{ Exception -> 0x0080 }
        r2 = r7.a;	 Catch:{ Exception -> 0x0080 }
        r2 = r2.a;	 Catch:{ Exception -> 0x0080 }
        r1[r5] = r2;	 Catch:{ Exception -> 0x0080 }
        r0.invoke(r14, r1);	 Catch:{ Exception -> 0x0080 }
        goto L_0x0098;
    L_0x0080:
        r0 = move-exception;
        r1 = r28.d();	 Catch:{ ClassNotFoundException -> 0x008d }
        r1 = r1.i;	 Catch:{ ClassNotFoundException -> 0x008d }
        r2 = "Failed to invoke Tag Manager's initialize() method";
        r1.b(r2, r0);	 Catch:{ ClassNotFoundException -> 0x008d }
        goto L_0x0098;
    L_0x008d:
        r0 = r28.d();
        r0 = r0.l;
        r1 = "Tag Manager is not found and thus will not be used";
        r0.a(r1);
    L_0x0098:
        r0 = r7.a;
        r0 = r0.g;
        r1 = c.e.a.b.f.b.p.e0;
        r0 = r0.o(r1);
        if (r0 == 0) goto L_0x00d0;
    L_0x00a4:
        r0 = "_cmp";
        r0 = r0.equals(r9);
        if (r0 == 0) goto L_0x00d0;
    L_0x00ac:
        r0 = "gclid";
        r1 = r12.containsKey(r0);
        if (r1 == 0) goto L_0x00d0;
    L_0x00b4:
        r4 = r12.getString(r0);
        r0 = r7.a;
        r0 = r0.n;
        r0 = (c.e.a.b.b.j.c) r0;
        java.util.Objects.requireNonNull(r0);
        r16 = java.lang.System.currentTimeMillis();
        r2 = "auto";
        r3 = "_lgclid";
        r1 = r28;
        r5 = r16;
        r1.K(r2, r3, r4, r5);
    L_0x00d0:
        r0 = c.e.a.b.e.c.ga.a();
        if (r0 == 0) goto L_0x010b;
    L_0x00d6:
        r0 = r7.a;
        r0 = r0.g;
        r1 = c.e.a.b.f.b.p.z0;
        r0 = r0.o(r1);
        if (r0 == 0) goto L_0x010b;
    L_0x00e2:
        if (r34 == 0) goto L_0x010b;
    L_0x00e4:
        r0 = c.e.a.b.f.b.t9.h;
        r1 = r0.length;
        r5 = 0;
    L_0x00e8:
        if (r5 >= r1) goto L_0x00f7;
    L_0x00ea:
        r2 = r0[r5];
        r2 = r2.equals(r9);
        if (r2 == 0) goto L_0x00f4;
    L_0x00f2:
        r5 = 0;
        goto L_0x00f8;
    L_0x00f4:
        r5 = r5 + 1;
        goto L_0x00e8;
    L_0x00f7:
        r5 = 1;
    L_0x00f8:
        if (r5 == 0) goto L_0x010b;
    L_0x00fa:
        r0 = r28.k();
        r1 = r28.l();
        r1 = r1.C;
        r1 = r1.a();
        r0.H(r12, r1);
    L_0x010b:
        r0 = 40;
        if (r36 == 0) goto L_0x019d;
    L_0x010f:
        r1 = "_iap";
        r1 = r1.equals(r9);
        if (r1 != 0) goto L_0x019d;
    L_0x0117:
        r1 = r7.a;
        r1 = r1.t();
        r2 = c.e.a.b.e.c.z7.a();
        if (r2 == 0) goto L_0x0131;
    L_0x0123:
        r2 = r7.a;
        r2 = r2.g;
        r3 = c.e.a.b.f.b.p.L0;
        r2 = r2.o(r3);
        if (r2 == 0) goto L_0x0131;
    L_0x012f:
        r5 = 1;
        goto L_0x0132;
    L_0x0131:
        r5 = 0;
    L_0x0132:
        r2 = "event";
        r3 = r1.a0(r2, r9);
        r4 = 2;
        if (r3 != 0) goto L_0x013c;
    L_0x013b:
        goto L_0x015a;
    L_0x013c:
        if (r5 == 0) goto L_0x0147;
    L_0x013e:
        r3 = c.e.a.b.f.b.v5.b;
        r3 = r1.f0(r2, r13, r3, r9);
        if (r3 != 0) goto L_0x0152;
    L_0x0146:
        goto L_0x014d;
    L_0x0147:
        r3 = r1.f0(r2, r13, r14, r9);
        if (r3 != 0) goto L_0x0152;
    L_0x014d:
        r5 = 13;
        r4 = 13;
        goto L_0x015a;
    L_0x0152:
        r1 = r1.Z(r2, r0, r9);
        if (r1 != 0) goto L_0x0159;
    L_0x0158:
        goto L_0x015a;
    L_0x0159:
        r4 = 0;
    L_0x015a:
        if (r4 == 0) goto L_0x019d;
    L_0x015c:
        r1 = r28.d();
        r1 = r1.h;
        r2 = r28.j();
        r2 = r2.u(r9);
        r3 = "Invalid public event name. Event will not be logged (FE)";
        r1.b(r3, r2);
        r1 = r7.a;
        r1.t();
        r0 = c.e.a.b.f.b.t9.E(r9, r0, r15);
        if (r9 == 0) goto L_0x0181;
    L_0x017a:
        r5 = r30.length();
        r18 = r5;
        goto L_0x0183;
    L_0x0181:
        r18 = 0;
    L_0x0183:
        r1 = r7.a;
        r1 = r1.t();
        r2 = r7.p;
        r3 = "_ev";
        r29 = r1;
        r30 = r2;
        r31 = r4;
        r32 = r3;
        r33 = r0;
        r34 = r18;
        r29.R(r30, r31, r32, r33, r34);
        return;
    L_0x019d:
        r1 = r28.q();
        r13 = 0;
        r1 = r1.w(r13);
        r6 = "_sc";
        if (r1 == 0) goto L_0x01b2;
    L_0x01aa:
        r2 = r12.containsKey(r6);
        if (r2 != 0) goto L_0x01b2;
    L_0x01b0:
        r1.d = r15;
    L_0x01b2:
        if (r34 == 0) goto L_0x01b8;
    L_0x01b4:
        if (r36 == 0) goto L_0x01b8;
    L_0x01b6:
        r5 = 1;
        goto L_0x01b9;
    L_0x01b8:
        r5 = 0;
    L_0x01b9:
        c.e.a.b.f.b.h7.A(r1, r12, r5);
        r1 = "am";
        r16 = r1.equals(r8);
        r1 = c.e.a.b.f.b.t9.r0(r30);
        if (r34 == 0) goto L_0x0212;
    L_0x01c8:
        r2 = r7.d;
        if (r2 == 0) goto L_0x0212;
    L_0x01cc:
        if (r1 != 0) goto L_0x0212;
    L_0x01ce:
        if (r16 != 0) goto L_0x0212;
    L_0x01d0:
        r0 = r28.d();
        r0 = r0.m;
        r1 = r28.j();
        r1 = r1.u(r9);
        r2 = r28.j();
        r2 = r2.s(r12);
        r3 = "Passing event to registered event handler (FE)";
        r0.c(r3, r1, r2);
        r0 = r7.d;
        r13 = r0;
        r13 = (com.google.android.gms.measurement.internal.AppMeasurementDynamiteService.a) r13;
        java.util.Objects.requireNonNull(r13);
        r1 = r13.a;	 Catch:{ RemoteException -> 0x0201 }
        r2 = r29;
        r3 = r30;
        r4 = r33;
        r5 = r31;
        r1.c0(r2, r3, r4, r5);	 Catch:{ RemoteException -> 0x0201 }
        goto L_0x0211;
    L_0x0201:
        r0 = move-exception;
        r1 = com.google.android.gms.measurement.internal.AppMeasurementDynamiteService.this;
        r1 = r1.a;
        r1 = r1.d();
        r1 = r1.i;
        r2 = "Event interceptor threw exception";
        r1.b(r2, r0);
    L_0x0211:
        return;
    L_0x0212:
        r1 = r7.a;
        r1 = r1.m();
        if (r1 != 0) goto L_0x021b;
    L_0x021a:
        return;
    L_0x021b:
        r1 = r28.k();
        r2 = c.e.a.b.e.c.z7.a();
        if (r2 == 0) goto L_0x0233;
    L_0x0225:
        r2 = r7.a;
        r2 = r2.g;
        r3 = c.e.a.b.f.b.p.L0;
        r2 = r2.o(r3);
        if (r2 == 0) goto L_0x0233;
    L_0x0231:
        r5 = 1;
        goto L_0x0234;
    L_0x0233:
        r5 = 0;
    L_0x0234:
        r1 = r1.t(r9, r5);
        if (r1 == 0) goto L_0x0277;
    L_0x023a:
        r2 = r28.d();
        r2 = r2.h;
        r3 = r28.j();
        r3 = r3.u(r9);
        r4 = "Invalid event name. Event will not be logged (FE)";
        r2.b(r4, r3);
        r28.k();
        r0 = c.e.a.b.f.b.t9.E(r9, r0, r15);
        if (r9 == 0) goto L_0x025b;
    L_0x0256:
        r5 = r30.length();
        r13 = r5;
    L_0x025b:
        r2 = r7.a;
        r2 = r2.t();
        r3 = r7.p;
        r4 = "_ev";
        r29 = r2;
        r30 = r3;
        r31 = r37;
        r32 = r1;
        r33 = r4;
        r34 = r0;
        r35 = r13;
        r29.S(r30, r31, r32, r33, r34, r35);
        return;
    L_0x0277:
        r0 = "_o";
        r5 = "_sn";
        r4 = "_si";
        r1 = new java.lang.String[]{r0, r5, r6, r4};
        r1 = java.util.Arrays.asList(r1);
        r17 = java.util.Collections.unmodifiableList(r1);
        r1 = r28.k();
        r2 = r37;
        r3 = r30;
        r14 = r4;
        r4 = r33;
        r12 = r5;
        r5 = r17;
        r15 = r6;
        r6 = r36;
        r5 = r1.z(r2, r3, r4, r5, r6);
        if (r5 == 0) goto L_0x02be;
    L_0x02a0:
        r1 = r5.containsKey(r15);
        if (r1 == 0) goto L_0x02be;
    L_0x02a6:
        r1 = r5.containsKey(r14);
        if (r1 != 0) goto L_0x02ad;
    L_0x02ac:
        goto L_0x02be;
    L_0x02ad:
        r5.getString(r12);
        r5.getString(r15);
        r1 = r5.getLong(r14);
        r1 = java.lang.Long.valueOf(r1);
        r1.longValue();
    L_0x02be:
        r1 = r7.a;
        r1 = r1.g;
        r2 = c.e.a.b.f.b.p.T;
        r1 = r1.o(r2);
        r12 = "_ae";
        r14 = 0;
        if (r1 == 0) goto L_0x02f3;
    L_0x02ce:
        r1 = r28.q();
        r1 = r1.w(r13);
        if (r1 == 0) goto L_0x02f3;
    L_0x02d8:
        r1 = r12.equals(r9);
        if (r1 == 0) goto L_0x02f3;
    L_0x02de:
        r1 = r28.s();
        r1 = r1.e;
        r1 = r1.b();
        r3 = (r1 > r14 ? 1 : (r1 == r14 ? 0 : -1));
        if (r3 <= 0) goto L_0x02f3;
    L_0x02ec:
        r3 = r28.k();
        r3.G(r5, r1);
    L_0x02f3:
        r1 = c.e.a.b.e.c.c9.a();
        if (r1 == 0) goto L_0x0372;
    L_0x02f9:
        r1 = r7.a;
        r1 = r1.g;
        r2 = c.e.a.b.f.b.p.p0;
        r1 = r1.o(r2);
        if (r1 == 0) goto L_0x0372;
    L_0x0305:
        r1 = "auto";
        r1 = r1.equals(r8);
        r2 = "_ffr";
        if (r1 != 0) goto L_0x0355;
    L_0x030f:
        r1 = "_ssr";
        r1 = r1.equals(r9);
        if (r1 == 0) goto L_0x0355;
    L_0x0317:
        r1 = r28.k();
        r2 = r5.getString(r2);
        r3 = c.e.a.b.b.j.g.a(r2);
        if (r3 == 0) goto L_0x0327;
    L_0x0325:
        r2 = 0;
        goto L_0x032b;
    L_0x0327:
        r2 = r2.trim();
    L_0x032b:
        r3 = r1.l();
        r3 = r3.z;
        r3 = r3.a();
        r3 = c.e.a.b.f.b.t9.q0(r2, r3);
        if (r3 == 0) goto L_0x0348;
    L_0x033b:
        r1 = r1.d();
        r1 = r1.m;
        r2 = "Not logging duplicate session_start_with_rollout event";
        r1.a(r2);
        r1 = 0;
        goto L_0x0352;
    L_0x0348:
        r1 = r1.l();
        r1 = r1.z;
        r1.b(r2);
        r1 = 1;
    L_0x0352:
        if (r1 != 0) goto L_0x0372;
    L_0x0354:
        return;
    L_0x0355:
        r1 = r12.equals(r9);
        if (r1 == 0) goto L_0x0372;
    L_0x035b:
        r1 = r28.k();
        r1 = r1.l();
        r1 = r1.z;
        r1 = r1.a();
        r3 = android.text.TextUtils.isEmpty(r1);
        if (r3 != 0) goto L_0x0372;
    L_0x036f:
        r5.putString(r2, r1);
    L_0x0372:
        r6 = new java.util.ArrayList;
        r6.<init>();
        r6.add(r5);
        r1 = r28.k();
        r1 = r1.v0();
        r1.nextLong();
        r1 = r28.l();
        r1 = r1.u;
        r1 = r1.a();
        r3 = (r1 > r14 ? 1 : (r1 == r14 ? 0 : -1));
        if (r3 <= 0) goto L_0x03fd;
    L_0x0393:
        r1 = r28.l();
        r1 = r1.u(r10);
        if (r1 == 0) goto L_0x03fd;
    L_0x039d:
        r1 = r28.l();
        r1 = r1.w;
        r1 = r1.b();
        if (r1 == 0) goto L_0x03fd;
    L_0x03a9:
        r1 = r28.d();
        r1 = r1.n;
        r2 = "Current session is expired, remove the session number, ID, and engagement time";
        r1.a(r2);
        r4 = 0;
        r1 = r7.a;
        r1 = r1.n;
        r1 = (c.e.a.b.b.j.c) r1;
        java.util.Objects.requireNonNull(r1);
        r19 = java.lang.System.currentTimeMillis();
        r2 = "auto";
        r3 = "_sid";
        r1 = r28;
        r13 = r5;
        r33 = r6;
        r5 = r19;
        r1.K(r2, r3, r4, r5);
        r1 = r7.a;
        r1 = r1.n;
        r1 = (c.e.a.b.b.j.c) r1;
        java.util.Objects.requireNonNull(r1);
        r5 = java.lang.System.currentTimeMillis();
        r2 = "auto";
        r3 = "_sno";
        r1 = r28;
        r1.K(r2, r3, r4, r5);
        r1 = r7.a;
        r1 = r1.n;
        r1 = (c.e.a.b.b.j.c) r1;
        java.util.Objects.requireNonNull(r1);
        r5 = java.lang.System.currentTimeMillis();
        r2 = "auto";
        r3 = "_se";
        r1 = r28;
        r1.K(r2, r3, r4, r5);
        goto L_0x0400;
    L_0x03fd:
        r13 = r5;
        r33 = r6;
    L_0x0400:
        r1 = "extend_session";
        r1 = r13.getLong(r1, r14);
        r3 = 1;
        r5 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1));
        if (r5 != 0) goto L_0x0423;
    L_0x040c:
        r1 = r28.d();
        r1 = r1.n;
        r2 = "EXTEND_SESSION param attached: initiate a new session or extend the current active session";
        r1.a(r2);
        r1 = r7.a;
        r1 = r1.r();
        r1 = r1.d;
        r2 = 1;
        r1.b(r10, r2);
    L_0x0423:
        r1 = r13.keySet();
        r2 = r13.size();
        r2 = new java.lang.String[r2];
        r1 = r1.toArray(r2);
        r1 = (java.lang.String[]) r1;
        java.util.Arrays.sort(r1);
        r2 = r1.length;
        r5 = 0;
    L_0x0438:
        if (r5 >= r2) goto L_0x047e;
    L_0x043a:
        r3 = r1[r5];
        r28.k();
        r4 = r13.get(r3);
        r6 = r4 instanceof android.os.Bundle;
        if (r6 == 0) goto L_0x0450;
    L_0x0447:
        r6 = 1;
        r14 = new android.os.Bundle[r6];
        r4 = (android.os.Bundle) r4;
        r6 = 0;
        r14[r6] = r4;
        goto L_0x0476;
    L_0x0450:
        r6 = r4 instanceof android.os.Parcelable[];
        if (r6 == 0) goto L_0x0461;
    L_0x0454:
        r4 = (android.os.Parcelable[]) r4;
        r6 = r4.length;
        r14 = android.os.Bundle[].class;
        r4 = java.util.Arrays.copyOf(r4, r6, r14);
        r14 = r4;
        r14 = (android.os.Bundle[]) r14;
        goto L_0x0476;
    L_0x0461:
        r6 = r4 instanceof java.util.ArrayList;
        if (r6 == 0) goto L_0x0475;
    L_0x0465:
        r4 = (java.util.ArrayList) r4;
        r6 = r4.size();
        r6 = new android.os.Bundle[r6];
        r4 = r4.toArray(r6);
        r14 = r4;
        r14 = (android.os.Bundle[]) r14;
        goto L_0x0476;
    L_0x0475:
        r14 = 0;
    L_0x0476:
        if (r14 == 0) goto L_0x047b;
    L_0x0478:
        r13.putParcelableArray(r3, r14);
    L_0x047b:
        r5 = r5 + 1;
        goto L_0x0438;
    L_0x047e:
        r13 = 0;
    L_0x047f:
        r1 = r33.size();
        if (r13 >= r1) goto L_0x0537;
    L_0x0485:
        r14 = r33;
        r1 = r14.get(r13);
        r1 = (android.os.Bundle) r1;
        if (r13 == 0) goto L_0x0491;
    L_0x048f:
        r5 = 1;
        goto L_0x0492;
    L_0x0491:
        r5 = 0;
    L_0x0492:
        if (r5 == 0) goto L_0x0497;
    L_0x0494:
        r2 = "_ep";
        goto L_0x0498;
    L_0x0497:
        r2 = r9;
    L_0x0498:
        r1.putString(r0, r8);
        if (r35 == 0) goto L_0x04a5;
    L_0x049d:
        r3 = r28.k();
        r1 = r3.y(r1);
    L_0x04a5:
        r15 = r1;
        r5 = new com.google.android.gms.measurement.internal.zzaq;
        r3 = new com.google.android.gms.measurement.internal.zzap;
        r3.m8197init(r15);
        r1 = r5;
        r4 = r29;
        r34 = r0;
        r0 = r5;
        r5 = r31;
        r1.m8200init(r2, r3, r4, r5);
        r1 = r28.p();
        java.util.Objects.requireNonNull(r1);
        r1.g();
        r1.t();
        r2 = r1.r();
        java.util.Objects.requireNonNull(r2);
        r3 = android.os.Parcel.obtain();
        r4 = 0;
        r0.writeToParcel(r3, r4);
        r5 = r3.marshall();
        r3.recycle();
        r3 = r5.length;
        r6 = 131072; // 0x20000 float:1.83671E-40 double:6.47582E-319;
        if (r3 <= r6) goto L_0x04ef;
    L_0x04e0:
        r2 = r2.d();
        r2 = r2.g;
        r3 = "Event is too long for local database. Sending event directly to service";
        r2.a(r3);
        r2 = 1;
        r24 = 0;
        goto L_0x04f6;
    L_0x04ef:
        r5 = r2.x(r4, r5);
        r24 = r5;
        r2 = 1;
    L_0x04f6:
        r26 = r1.I(r2);
        r2 = new c.e.a.b.f.b.d8;
        r23 = 1;
        r21 = r2;
        r22 = r1;
        r25 = r0;
        r27 = r37;
        r21.m1396init(r22, r23, r24, r25, r26, r27);
        r1.z(r2);
        if (r16 != 0) goto L_0x052f;
    L_0x050e:
        r0 = r7.e;
        r0 = r0.iterator();
    L_0x0514:
        r1 = r0.hasNext();
        if (r1 == 0) goto L_0x052f;
    L_0x051a:
        r1 = r0.next();
        r1 = (c.e.a.b.f.b.z5) r1;
        r4 = new android.os.Bundle;
        r4.<init>(r15);
        r2 = r29;
        r3 = r30;
        r5 = r31;
        r1.a(r2, r3, r4, r5);
        goto L_0x0514;
    L_0x052f:
        r13 = r13 + 1;
        r0 = r34;
        r33 = r14;
        goto L_0x047f;
    L_0x0537:
        r0 = r28.q();
        r1 = 0;
        r0 = r0.w(r1);
        if (r0 == 0) goto L_0x055d;
    L_0x0542:
        r0 = r12.equals(r9);
        if (r0 == 0) goto L_0x055d;
    L_0x0548:
        r0 = r28.s();
        r1 = r7.a;
        r1 = r1.n;
        r1 = (c.e.a.b.b.j.c) r1;
        java.util.Objects.requireNonNull(r1);
        r1 = android.os.SystemClock.elapsedRealtime();
        r3 = 1;
        r0.w(r3, r3, r1);
    L_0x055d:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.c6.F(java.lang.String, java.lang.String, long, android.os.Bundle, boolean, boolean, boolean, java.lang.String):void");
    }

    public final void G(String str, String str2, long j, Object obj) {
        a().v(new j6(this, str, str2, obj, j));
    }

    public final void H(String str, String str2, Bundle bundle) {
        Objects.requireNonNull((c) this.a.n);
        I(str, str2, bundle, true, true, System.currentTimeMillis());
    }

    public final void I(String str, String str2, Bundle bundle, boolean z, boolean z2, long j) {
        String str3 = str == null ? "app" : str;
        Bundle bundle2 = bundle == null ? new Bundle() : bundle;
        String string;
        if (this.a.g.o(p.v0)) {
            if (t9.q0(str2, "screen_view")) {
                h7 q = q();
                if (q.a.g.o(p.v0)) {
                    synchronized (q.l) {
                        if (q.k) {
                            String string2 = bundle2.getString("screen_name");
                            if (string2 == null || (string2.length() > 0 && string2.length() <= 100)) {
                                string = bundle2.getString("screen_class");
                                if (string == null || (string.length() > 0 && string.length() <= 100)) {
                                    String x;
                                    if (string == null) {
                                        Activity activity = q.g;
                                        x = activity != null ? h7.x(activity.getClass().getCanonicalName()) : "Activity";
                                    } else {
                                        x = string;
                                    }
                                    if (q.h && q.c != null) {
                                        q.h = false;
                                        boolean q0 = t9.q0(q.c.b, x);
                                        boolean q02 = t9.q0(q.c.a, string2);
                                        if (q0 && q02) {
                                            q.d().k.a("Ignoring call to log screen view event with duplicate parameters.");
                                        }
                                    }
                                    q.d().n.c("Logging screen view with name, class", string2 == null ? "null" : string2, x == null ? "null" : x);
                                    i7 i7Var = q.c == null ? q.d : q.c;
                                    i7 i7Var2 = new i7(string2, x, q.k().t0(), true, j);
                                    q.c = i7Var2;
                                    q.d = i7Var;
                                    q.i = i7Var2;
                                    Objects.requireNonNull((c) q.a.n);
                                    q.a().v(new k7(q, bundle2, i7Var2, i7Var, SystemClock.elapsedRealtime()));
                                } else {
                                    q.d().k.b("Invalid screen class length for screen view. Length", Integer.valueOf(string.length()));
                                }
                            } else {
                                q.d().k.b("Invalid screen name length for screen view. Length", Integer.valueOf(string2.length()));
                            }
                        } else {
                            q.d().k.a("Cannot log screen view event when the app is in the background.");
                        }
                    }
                } else {
                    q.d().k.a("Manual screen reporting is disabled.");
                }
                return;
            }
        }
        string = str2;
        boolean z3 = !z2 || this.d == null || t9.r0(str2);
        Q(str3, str2, j, bundle2, z2, z3, z ^ 1, null);
    }

    public final void J(String str, String str2, Object obj) {
        Objects.requireNonNull((c) this.a.n);
        L(str, str2, obj, true, System.currentTimeMillis());
    }

    /* JADX WARNING: Removed duplicated region for block: B:22:0x0076  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x006a  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x006a  */
    /* JADX WARNING: Removed duplicated region for block: B:22:0x0076  */
    public final void K(java.lang.String r9, java.lang.String r10, java.lang.Object r11, long r12) {
        /*
        r8 = this;
        b.i.b.f.N(r9);
        b.i.b.f.N(r10);
        r8.g();
        r8.t();
        r0 = "allow_personalized_ads";
        r0 = r0.equals(r10);
        r1 = "_npa";
        if (r0 == 0) goto L_0x0060;
    L_0x0016:
        r0 = r11 instanceof java.lang.String;
        if (r0 == 0) goto L_0x0050;
    L_0x001a:
        r0 = r11;
        r0 = (java.lang.String) r0;
        r2 = android.text.TextUtils.isEmpty(r0);
        if (r2 != 0) goto L_0x0050;
    L_0x0023:
        r10 = java.util.Locale.ENGLISH;
        r10 = r0.toLowerCase(r10);
        r11 = "false";
        r10 = r11.equals(r10);
        r2 = 1;
        if (r10 == 0) goto L_0x0035;
    L_0x0033:
        r4 = r2;
        goto L_0x0037;
    L_0x0035:
        r4 = 0;
    L_0x0037:
        r10 = java.lang.Long.valueOf(r4);
        r0 = r8.l();
        r0 = r0.s;
        r4 = r10.longValue();
        r6 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1));
        if (r6 != 0) goto L_0x004b;
    L_0x0049:
        r11 = "true";
    L_0x004b:
        r0.b(r11);
        r6 = r10;
        goto L_0x005e;
    L_0x0050:
        if (r11 != 0) goto L_0x0060;
    L_0x0052:
        r10 = r8.l();
        r10 = r10.s;
        r0 = "unset";
        r10.b(r0);
        r6 = r11;
    L_0x005e:
        r3 = r1;
        goto L_0x0062;
    L_0x0060:
        r3 = r10;
        r6 = r11;
    L_0x0062:
        r10 = r8.a;
        r10 = r10.i();
        if (r10 != 0) goto L_0x0076;
    L_0x006a:
        r9 = r8.d();
        r9 = r9.n;
        r10 = "User property not set since app measurement is disabled";
        r9.a(r10);
        return;
    L_0x0076:
        r10 = r8.a;
        r10 = r10.m();
        if (r10 != 0) goto L_0x007f;
    L_0x007e:
        return;
    L_0x007f:
        r10 = new com.google.android.gms.measurement.internal.zzku;
        r2 = r10;
        r4 = r12;
        r7 = r9;
        r2.m8204init(r3, r4, r6, r7);
        r9 = r8.p();
        r9.g();
        r9.t();
        r11 = r9.r();
        java.util.Objects.requireNonNull(r11);
        r12 = android.os.Parcel.obtain();
        r13 = 0;
        r10.writeToParcel(r12, r13);
        r0 = r12.marshall();
        r12.recycle();
        r12 = r0.length;
        r1 = 131072; // 0x20000 float:1.83671E-40 double:6.47582E-319;
        r2 = 1;
        if (r12 <= r1) goto L_0x00b9;
    L_0x00ad:
        r11 = r11.d();
        r11 = r11.g;
        r12 = "User property too long for local database. Sending directly to service";
        r11.a(r12);
        goto L_0x00bd;
    L_0x00b9:
        r13 = r11.x(r2, r0);
    L_0x00bd:
        r11 = r9.I(r2);
        r12 = new c.e.a.b.f.b.r7;
        r12.m1483init(r9, r13, r10, r11);
        r9.z(r12);
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.c6.K(java.lang.String, java.lang.String, java.lang.Object, long):void");
    }

    public final void L(String str, String str2, Object obj, boolean z, long j) {
        int h0;
        if (str == null) {
            str = "app";
        }
        String str3 = str;
        if (z) {
            h0 = k().h0(str2);
        } else {
            t9 k = k();
            String str4 = "user property";
            if (k.a0(str4, str2)) {
                if (!k.f0(str4, x5.a, null, str2)) {
                    h0 = 15;
                } else if (k.Z(str4, 24, str2)) {
                    h0 = 0;
                }
            }
            h0 = 6;
        }
        if (h0 != 0) {
            k();
            this.a.t().R(this.p, h0, "_ev", t9.E(str2, 24, true), str2 != null ? str2.length() : 0);
        } else if (obj != null) {
            h0 = k().i0(str2, obj);
            if (h0 != 0) {
                int length;
                k();
                String E = t9.E(str2, 24, true);
                if ((obj instanceof String) || (obj instanceof CharSequence)) {
                    length = String.valueOf(obj).length();
                } else {
                    length = 0;
                }
                this.a.t().R(this.p, h0, "_ev", E, length);
                return;
            }
            Object n0 = k().n0(str2, obj);
            if (n0 != null) {
                G(str3, str2, j, n0);
            }
        } else {
            G(str3, str2, j, null);
        }
    }

    public final void M() {
        if (this.a.a.getApplicationContext() instanceof Application) {
            ((Application) this.a.a.getApplicationContext()).unregisterActivityLifecycleCallbacks(this.c);
        }
    }

    public final void N() {
        g();
        t();
        if (this.a.m()) {
            if (this.a.g.o(p.d0)) {
                Boolean w = this.a.g.w("google_analytics_deferred_deep_link_enabled");
                Object obj = (w == null || !w.booleanValue()) ? null : 1;
                if (obj != null) {
                    d().m.a("Deferred Deep Link feature enabled.");
                    a().v(new e6(this));
                }
            }
            q7 p = p();
            p.g();
            p.t();
            zzn I = p.I(true);
            p.r().x(3, new byte[0]);
            p.z(new x7(p, I));
            this.o = false;
            d4 l = l();
            l.g();
            String str = "previous_os_version";
            String string = l.w().getString(str, null);
            l.i().o();
            String str2 = VERSION.RELEASE;
            if (!(TextUtils.isEmpty(str2) || str2.equals(string))) {
                Editor edit = l.w().edit();
                edit.putString(str, str2);
                edit.apply();
            }
            if (!TextUtils.isEmpty(string)) {
                i().o();
                if (!string.equals(str2)) {
                    Bundle bundle = new Bundle();
                    bundle.putString("_po", string);
                    H("auto", "_ou", bundle);
                }
            }
        }
    }

    public final String O() {
        u4 u4Var = this.a;
        String str = u4Var.b;
        if (str != null) {
            return str;
        }
        try {
            return d.u(u4Var.a, "google_app_id");
        } catch (IllegalStateException e) {
            this.a.d().f.b("getGoogleAppId failed with exception", e);
            return null;
        }
    }

    public final void P() {
        g();
        String a = l().s.a();
        if (a != null) {
            if ("unset".equals(a)) {
                Objects.requireNonNull((c) this.a.n);
                K("app", "_npa", null, System.currentTimeMillis());
            } else {
                Long valueOf = Long.valueOf("true".equals(a) ? 1 : 0);
                Objects.requireNonNull((c) this.a.n);
                K("app", "_npa", valueOf, System.currentTimeMillis());
            }
        }
        boolean z = true;
        if (this.a.i() && this.o) {
            d().m.a("Recording app launch after enabling measurement for the first time (FE)");
            N();
            if (t9.a() && this.a.g.o(p.q0)) {
                s().d.a();
            }
            if (((l9) i9.b.q()).q() && this.a.g.o(p.t0)) {
                if (this.a.w.a.o().k.a() <= 0) {
                    z = false;
                }
                if (!z) {
                    m4 m4Var = this.a.w;
                    m4Var.a(m4Var.a.a.getPackageName());
                }
            }
            if (this.a.g.o(p.D0)) {
                a().v(new f6(this));
            }
            return;
        }
        d().m.a("Updating Scion state (FE)");
        q7 p = p();
        p.g();
        p.t();
        p.z(new b8(p, p.I(true)));
    }

    public final void Q(String str, String str2, long j, Bundle bundle, boolean z, boolean z2, boolean z3, String str3) {
        Bundle bundle2 = new Bundle(bundle);
        for (String str4 : bundle2.keySet()) {
            Object obj = bundle2.get(str4);
            if (obj instanceof Bundle) {
                bundle2.putBundle(str4, new Bundle((Bundle) obj));
            } else {
                int i = 0;
                if (obj instanceof Parcelable[]) {
                    Parcelable[] parcelableArr = (Parcelable[]) obj;
                    while (i < parcelableArr.length) {
                        if (parcelableArr[i] instanceof Bundle) {
                            parcelableArr[i] = new Bundle((Bundle) parcelableArr[i]);
                        }
                        i++;
                    }
                } else if (obj instanceof List) {
                    List list = (List) obj;
                    while (i < list.size()) {
                        Object obj2 = list.get(i);
                        if (obj2 instanceof Bundle) {
                            list.set(i, new Bundle((Bundle) obj2));
                        }
                        i++;
                    }
                }
            }
        }
        a().v(new k6(this, str, str2, j, bundle2, z, z2, z3, null));
    }

    public final void R(String str, String str2, Bundle bundle) {
        Objects.requireNonNull((c) this.a.n);
        long currentTimeMillis = System.currentTimeMillis();
        f.N(str);
        Bundle bundle2 = new Bundle();
        bundle2.putString(RankingConst.RANKING_JGW_NAME, str);
        bundle2.putLong("creation_timestamp", currentTimeMillis);
        if (str2 != null) {
            bundle2.putString("expired_event_name", str2);
            bundle2.putBundle("expired_event_params", bundle);
        }
        a().v(new p6(this, bundle2));
    }

    public final boolean v() {
        return false;
    }

    public final void w(long j, boolean z) {
        g();
        t();
        d().m.a("Resetting analytics data (FE)");
        w8 s = s();
        s.g();
        d9 d9Var = s.e;
        d9Var.c.c();
        d9Var.a = 0;
        d9Var.b = 0;
        boolean i = this.a.i();
        d4 l = l();
        l.j.b(j);
        if (!TextUtils.isEmpty(l.l().z.a())) {
            l.z.b(null);
        }
        if (t9.a() && l.a.g.o(p.q0)) {
            l.u.b(0);
        }
        if (!l.a.g.x()) {
            l.v(i ^ 1);
        }
        l.A.b(null);
        l.B.b(0);
        l.C.b(null);
        if (z) {
            q7 p = p();
            p.g();
            p.t();
            zzn I = p.I(false);
            p.r().y();
            p.z(new t7(p, I));
        }
        if (t9.a() && this.a.g.o(p.q0)) {
            s().d.a();
        }
        this.o = i ^ 1;
    }

    public final void x(Bundle bundle, int i, long j) {
        if (v8.a() && this.a.g.o(p.H0)) {
            t();
            Object string = bundle.getString("ad_storage");
            if (string == null || d.i(string) != null) {
                string = bundle.getString("analytics_storage");
                if (string == null || d.i(string) != null) {
                    string = null;
                }
            }
            if (string != null) {
                d().k.b("Ignoring invalid consent setting", string);
                d().k.a("Valid consent values are 'granted', 'denied'");
            }
            A(d.g(bundle), i, j);
        }
    }

    public final void y(Bundle bundle, long j) {
        Bundle bundle2 = bundle;
        Class cls = Long.class;
        Class cls2 = String.class;
        String str = "null reference";
        Objects.requireNonNull(bundle, str);
        Bundle bundle3 = new Bundle(bundle);
        String str2 = HiAnalyticsConstant.BI_KEY_APP_ID;
        if (!TextUtils.isEmpty(bundle3.getString(str2))) {
            d().i.a("Package name should be null when calling setConditionalUserProperty");
        }
        bundle3.remove(str2);
        d.s(bundle3, str2, cls2, null);
        str2 = "origin";
        d.s(bundle3, str2, cls2, null);
        String str3 = RankingConst.RANKING_JGW_NAME;
        d.s(bundle3, str3, cls2, null);
        String str4 = "value";
        d.s(bundle3, str4, Object.class, null);
        String str5 = "trigger_event_name";
        d.s(bundle3, str5, cls2, null);
        String str6 = "trigger_timeout";
        d.s(bundle3, str6, cls, Long.valueOf(0));
        d.s(bundle3, "timed_out_event_name", cls2, null);
        d.s(bundle3, "timed_out_event_params", Bundle.class, null);
        d.s(bundle3, "triggered_event_name", cls2, null);
        d.s(bundle3, "triggered_event_params", Bundle.class, null);
        String str7 = "time_to_live";
        d.s(bundle3, str7, cls, Long.valueOf(0));
        d.s(bundle3, "expired_event_name", cls2, null);
        d.s(bundle3, "expired_event_params", Bundle.class, null);
        f.N(bundle3.getString(str3));
        f.N(bundle3.getString(str2));
        Objects.requireNonNull(bundle3.get(str4), str);
        bundle3.putLong("creation_timestamp", j);
        str2 = bundle3.getString(str3);
        Object obj = bundle3.get(str4);
        if (k().h0(str2) != 0) {
            d().f.b("Invalid conditional user property name", j().y(str2));
        } else if (k().i0(str2, obj) != 0) {
            d().f.c("Invalid conditional user property value", j().y(str2), obj);
        } else {
            Object n0 = k().n0(str2, obj);
            if (n0 == null) {
                d().f.c("Unable to normalize conditional user property value", j().y(str2), obj);
                return;
            }
            d.C(bundle3, n0);
            long j2 = bundle3.getLong(str6);
            if (TextUtils.isEmpty(bundle3.getString(str5)) || (j2 <= 15552000000L && j2 >= 1)) {
                j2 = bundle3.getLong(str7);
                if (j2 > 15552000000L || j2 < 1) {
                    d().f.c("Invalid conditional user property time to live", j().y(str2), Long.valueOf(j2));
                    return;
                }
                a().v(new n6(this, bundle3));
                return;
            }
            d().f.c("Invalid conditional user property timeout", j().y(str2), Long.valueOf(j2));
        }
    }

    public final void z(d dVar) {
        g();
        boolean z = (dVar.k() && dVar.j()) || p().E();
        if (z != this.a.k()) {
            Boolean valueOf;
            u4 u4Var = this.a;
            u4Var.a().g();
            u4Var.D = z;
            d4 l = l();
            Objects.requireNonNull(l);
            if (v8.a() && l.a.g.o(p.H0)) {
                l.g();
                String str = "measurement_enabled_from_api";
                if (l.w().contains(str)) {
                    valueOf = Boolean.valueOf(l.w().getBoolean(str, true));
                    if (z || valueOf == null || valueOf.booleanValue()) {
                        D(Boolean.valueOf(z), false);
                    }
                    return;
                }
            }
            valueOf = null;
            if (z) {
            }
            D(Boolean.valueOf(z), false);
        }
    }
}
